package jgl.vajra.driver.widget.retrofithelper.http;


import jgl.vajra.driver.bean.LoginInfoBean;
import jgl.vajra.driver.widget.bean.BannerInfo;

import jgl.vajra.driver.widget.bean.BaseRequestData;
import jgl.vajra.driver.widget.bean.UploadFileBean;

import java.util.List;
import java.util.Map;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import retrofit2.Call;
import retrofit2.http.Body;
import retrofit2.http.Field;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.PUT;
import retrofit2.http.QueryMap;

/**
 * @Author zhangshuqi
 * @CreateTime 2018/4/10
 * @Describe
 */

public interface ApiServer {
    @FormUrlEncoded
    @POST("v1/SaveFile/base64")
    Observable<BaseRequestData<List<UploadFileBean>>> uploadFileWithRequestBody(@Field("base64") String multipartBody);

    @POST("crm/upload/addFile")
    Observable<BaseRequestData<String>> uploadFileWithRequestBody(@Body MultipartBody multipartBody);

    Observable<BaseRequestData<List<BannerInfo>>> getBannerInfo(Map<String, Object> map);

    @FormUrlEncoded
    @POST("account/autoRegisterAndBind")
    Observable<BaseRequestData<String>> register(@FieldMap Map<String, Object> map);

    @FormUrlEncoded
    @POST("account/resetPwd")
    Observable<BaseRequestData<Object>> passwordReset(@FieldMap Map<String, Object> map);

    @FormUrlEncoded
    @POST("account/setPwd")
    Observable<BaseRequestData<Boolean>> passwordSet(@FieldMap Map<String, Object> map);


    @FormUrlEncoded
    @POST("account/login")
    Observable<BaseRequestData<String>> login(@FieldMap Map<String, Object> map);

    @PUT("v1/member/Password_Set")
    Observable<BaseRequestData<Object>> editPassword(@Body Map<String, Object> map);

    @FormUrlEncoded
    @POST("account/sendValidCode")
    Observable<BaseRequestData<Object>> getVerifyCode(@FieldMap Map<String, Object> map);

    @GET("account/sendValidCode4Test")
    Observable<BaseRequestData<String>> getVerifyTestCode(@QueryMap Map<String, Object> map);

    @GET("v1/member/reauth")
    Observable<BaseRequestData<LoginInfoBean>> refreshToken();

    @GET("v1/member/reauth")
    Call<BaseRequestData<LoginInfoBean>> refreshTokenCall();



    @GET("push/jpush/getMyCourseTagId")
    Observable<BaseRequestData<List<String>>> getMyCourseTagId();


    @POST("user/location/record")
    Observable<BaseRequestData<Object>>  uploadLocation(@Body Map<String, Object> map);
}




